function initDate(dateStr) {
  const dt = new Date(dateStr)
  const y = dt.getFullYear()
  const m = patchZero(dt.getMonth() + 1)
  const d = patchZero(dt.getDate())
  const hh = patchZero(dt.getHours())
  const mm = patchZero(dt.getMinutes())
  const ss = patchZero(dt.getSeconds())
  return `${y}-${m}-${d} ${hh}:${mm}:${ss}`
}
function patchZero(n) {
  return n >= 10 ? n : '0' + n
}
module.exports = {
  initDate
}